"use strict";
cc._RF.push(module, '7a036XXtCZPlLQrTCq1SczV', 'HallCarControl');
// scripts/HallCarControl.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("AssemblyItem"),
    s = t("CarConstant"),
    l = t("HallWeaponControl"),
    c = t("HallToolsControl"),
    d = cc._decorator,
    h = d.ccclass,
    p = d.property,
    u = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.assemblyItem = null, e._assemblyView = null, e.otherEnterUid = null, e.otherExitUid = null, e.otherEquipIndex = 0, e;
  }

  var o;
  return n(e, t), o = e, e.prototype.onCollisionEnter = function (t, e) {
    if (e.tag == s.colliderTag.Hall.body && "move" == this.assemblyItem.getTouchState()) {
      switch (this.otherExitUid = null, t.tag) {
        case s.colliderTag.Hall.body:
          this.otherEnterUid = t.node.getComponent(o).getCarUid();
          break;

        case s.colliderTag.Hall.wheel:
          return;

        case s.colliderTag.Hall.weapon:
          this.otherEnterUid = t.node.getComponent(l["default"]).getWeaponUid();
          break;

        case s.colliderTag.Hall.tools:
          this.otherEnterUid = t.node.getComponent(c["default"]).getToolsUid();
          break;

        case s.colliderTag.assembly.body:
          this.otherEnterUid = this.assemblyItem.getTouchMoveUid();
          break;

        case s.colliderTag.assembly.wheel:
          return;

        case s.colliderTag.assembly.weapon:
          this.otherEnterUid = this.assemblyItem.getTouchMoveUid();

        case s.colliderTag.assembly.tools:
          this.otherEnterUid = this.assemblyItem.getTouchMoveUid();
      }

      this.assemblyItem.onEquipCarItem(this.otherEnterUid, this.otherExitUid, t.tag, this.otherEquipIndex);
    }
  }, e.prototype.onCollisionExit = function (t, e) {
    if ("move" == this.assemblyItem.getTouchState() && e.tag == s.colliderTag.Hall.body) {
      switch (cc.log("dddddddddd"), this.otherEnterUid = null, t.tag) {
        case s.colliderTag.Hall.body:
          this.otherExitUid = t.node.getComponent(o).getCarUid();
          break;

        case s.colliderTag.Hall.wheel:
          return;

        case s.colliderTag.Hall.weapon:
          this.otherExitUid = t.node.getComponent(l["default"]).getWeaponUid();
          break;

        case s.colliderTag.Hall.tools:
          this.otherExitUid = t.node.getComponent(c["default"]).getToolsUid();
          break;

        case s.colliderTag.assembly.body:
          this.otherExitUid = null;
          break;

        case s.colliderTag.assembly.wheel:
          return;

        case s.colliderTag.assembly.weapon:
        case s.colliderTag.assembly.tools:
          this.otherExitUid = this.assemblyItem.getTouchMoveUid();
      }

      this.assemblyItem.onEquipCarItem(this.otherEnterUid, this.otherExitUid, t.tag, this.otherEquipIndex);
    }
  }, e.prototype.getCarUid = function () {
    this.assemblyItem.getItemUid();
  }, e.prototype.playAudio = function (t) {
    this.assemblyItem.playAudio(t);
  }, a([p(r.AssemblyItem)], e.prototype, "assemblyItem", void 0), o = a([h], e);
}(cc.Component);

o["default"] = u;

cc._RF.pop();